@echo off

rem === Set additional libs
rem == Note: separator is ;
rem set AddonLibs=..\libgdi\lib\libgdi.so
rem set AddonDefs=

rem === Configuring compiler and vars
call :job configure

rem === Cleaning bin directory
rem  Usage: clean <mode: none|bin|leaveobj|all>
call :job clean all

rem === Compiling elfs
rem == Usage: build <target: elf|lib> <release: none|debug|task>
call :job build elf debug
if errorlevel 1 goto clean

call :job build elf
if errorlevel 1 goto clean

call :job build elf task
if errorlevel 1 goto clean

rem call :job build lib

rem === Archiving files
rem == Usage: archive <mode: src|all>
rem call :job archive src
rem call :job archive all

:clean
call :job clean

exit

:job
call ..\zconfig.bat %1 %2 %3
exit /b %errorlevel%